home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_hint2.cog < prev    next >
Text File  |  1999-11-15  |  18KB  |  524 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_Hint2.cog
  4. #
  5. # Solves hints 
  6. #
  7. #   Basically, considers hints as one linear list with discrete groups located within   
  8. # that whole. For example a list of objects array indexed from 0-9 could contain a sub group of objects
  9. # index numbered from 6-8. The first item in this sub group of objects could be accessed 
  10. # directly by retrieving the value stored in index 6 and so forth. What this allows for is
  11. # non linear access to a linear list of objects. For example if jump to a part of the level that
  12. # uses hints 6-8 but I have only solved hints 1 and 2 the current hint system will show the next hint as 
  13. # hint 3 which not only confusing but wrong. This way when Indy enters any part of the level (you have to track this)
  14. # he can force the hint to be teleported to hint 6 and so forth.
  15. #   The other important thing to remember is that there is only one hint that is never solved or unsolved.
  16. # the hint is just teleported to the appropriate position based on where the player decided to go, hence 
  17. # non-linear behavior from linear list.
  18. # [SXC]
  19. #
  20. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  21. # ========================================================================================
  22.  
  23. symbols
  24.  
  25.     message     startup
  26.     message     activate
  27.     message     entered
  28.     message     arrived
  29.     message     damaged
  30.     message     crossed
  31.     message     user1
  32.     message     user4
  33.     message     user5
  34.     message     user6
  35.  
  36.     thing       player      local
  37.     
  38. # A REAL HINT FROM THE TEMPLATE
  39.     thing       curhint
  40.          
  41. # GHOST OBJECTS STANDING IN FOR HINTS
  42.     thing       ghint00     
  43.     thing       ghint01
  44.     thing       ghint02
  45.     thing       ghint03
  46.     thing       ghint04        
  47.     thing       ghint05        
  48.     thing       ghint06        
  49.     thing       ghint07        
  50.     thing       ghint08        
  51.     thing       ghint09        
  52.     thing       ghint10
  53.     thing       ghint11
  54.     thing       ghint12
  55.     thing       ghint13
  56.     thing       ghint14
  57.     thing       ghint15
  58.     thing       ghint16
  59.     thing       ghint17
  60.     thing       ghint18
  61.     thing       ghint19
  62.     thing       ghint20
  63.     thing       ghint21
  64.     thing       ghint22
  65.     thing       ghint23
  66.     thing       ghint24
  67.     thing       ghint25
  68.     
  69. # LIST OF ITEMS IN LEVEL        
  70.     thing       ghint00_switch      
  71.     thing       ghint01_waterkey
  72.     thing       ghint02_switch
  73.     sector      ghint03_sector
  74.     sector      snakesect0_h4      
  75.     sector      snakesect1_h5      
  76.     sector      snakesect2_h6      
  77.     sector      ghint07_sector
  78.     # hint 8 is the lightshaft in the statlock room
  79.     
  80. # GATEWAY FOR SUBGROUP 9 VOLODSCENE
  81.     surface         gh8_index9_surf_in                          
  82.     surface         gh8_index0_surf_out    
  83.     sector          ghint09_sector
  84.     thing           ghint10_key
  85.     # hint 11 is the fish switch in the underwater switch room
  86.     # hint 12 is the whip climb above the water pillar
  87.     sector          ghint12_sector
  88.     # hint 13 is the whip swing high above the water
  89.     # hint 14 is the fish idol
  90.     # hint 15 is the mirror
  91.     
  92. # GATEWAY FOR SUBGROUP 16 HABBIRD
  93.     surface         gh8_index16_surf_in                         
  94.     surface         gh8_index16_surf_out
  95.     sector          ghint16_sector
  96.     sector          ghint17_sector
  97.     thing           ghint18_switch
  98.     thing           ghint19_birdidol
  99.     
  100. # GATEWAY FOR SUBGROUP 20 THEATRE    
  101.     surface         gh8_index20_surf_in                         
  102.     surface         gh8_index20_surf_out
  103.     sector          ghint20_sector
  104.     sector          ghint21_sector
  105.     thing           ghint22_jagidol
  106.     
  107. # GATEWAY FOR SUBGROUP 23 IDOLROOM
  108.     surface         gh8_index23_surf_in                         
  109.     surface         gh8_index23_surf_out
  110.     sector          ghint23_sector
  111.     
  112. # LIST OF INTS SET TO EITHER 0(UNSOLVED) OR 1(SOLVED)    
  113.     int             ghintint00=0                    local        
  114.     int             ghintint01=0                    local
  115.     int             ghintint02=0                    local
  116.     int             ghintint03=0                    local
  117.     int             ghintint04=0                    local
  118.     int             ghintint05=0                    local
  119.     int             ghintint06=0                    local
  120.     int             ghintint07=0                    local
  121.     int             ghintint08=0                    local
  122.     int             ghintint09=0                    local
  123.     int             ghintint10=0                    local
  124.     int             ghintint11=0                    local
  125.     int             ghintint12=0                    local
  126.     int             ghintint13=0                    local
  127.     int             ghintint14=0                    local
  128.     int             ghintint15=0                    local
  129.     int             ghintint16=0                    local
  130.     int             ghintint17=0                    local
  131.     int             ghintint18=0                    local
  132.     int             ghintint19=0                    local
  133.     int             ghintint20=0                    local
  134.     int             ghintint21=0                    local
  135.     int             ghintint22=0                    local
  136.     int             ghintint23=0                    local
  137.     int             ghintint24=0                    local
  138.     int             ghintint25=0                    local
  139.     
  140.     int             curhintindex=0                              # value of the current unsolved hint
  141.     int             curhintref=0                    local       # first number in a given group of hints
  142.     int             hintint_index=0                 local       # counter variable. gets set to the first in the group
  143.     int             doneyet=0                       local
  144.     
  145.     flex            findlowestunsolved              local
  146.     flex            movehintpos                     local
  147.     flex            habitraildone                   local           
  148. end
  149.  
  150. code
  151.  
  152. # ========================================================================================
  153. startup:
  154.  
  155.     player = GetLocalPlayerThing();
  156.     
  157. return;
  158.  
  159. # ========================================================================================
  160. activate:
  161.     
  162.     if ((GetSenderRef() == ghint00_switch) && (ghintint00 == 0))
  163.     {
  164.         ghintint00=1;                               //set this hint solved
  165.         curhintref=0;                               //set current hint group reference num
  166.         call findlowestunsolved;                    //find the lowest unsolved hint in that group
  167.         call movehintpos;                           //pop the hint to the next valid hint position
  168.     }
  169.     
  170.     if ((GetSenderRef() == ghint01_waterkey) && (ghintint01 == 0))
  171.     {
  172.         ghintint01=1;
  173.         curhintref=0;
  174.         call findlowestunsolved;
  175.         call movehintpos;
  176.     }
  177.     
  178.     if ((GetSenderRef() == ghint02_switch) && (ghintint02 == 0))
  179.     {
  180.         ghintint02=1;
  181.         curhintref=0;
  182.         call findlowestunsolved;
  183.         call movehintpos;
  184.     }
  185.     
  186.     if ((GetSenderRef() == ghint14) && (ghintint14 == 0))
  187.     {
  188.         ghintint14=1;
  189.         curhintref=9;
  190.         call findlowestunsolved;
  191.         call movehintpos;
  192.     }
  193.     
  194.     if ((GetSenderRef() == ghint15) && (ghintint15 == 0))
  195.     {
  196.         //at the mirror setting hint back to refnum 0
  197.         ghintint15=1;
  198.         doneyet = doneyet + 1;
  199.         call habitraildone;
  200.         call findlowestunsolved;
  201.         call movehintpos;
  202.     }
  203.     
  204.     if ((GetSenderRef() == ghint18_switch) && (ghintint18 == 0))
  205.     {
  206.         ghintint18=1;
  207.         curhintref=16;
  208.         call findlowestunsolved;
  209.         call movehintpos;
  210.     }
  211.     
  212.     if ((GetSenderRef() == ghint19_birdidol) && (ghintint19 == 0))
  213.     {
  214.         // at birdidol setting hint refnum back to 0
  215.         ghintint18=1;
  216.         doneyet = doneyet + 1;
  217.         call habitraildone;
  218.         call findlowestunsolved;
  219.         call movehintpos;
  220.     }
  221.     
  222.     if ((GetSenderRef() == ghint22_jagidol) && (ghintint22 == 0))
  223.     {
  224.         // at jagidol setting hint refnum back to 0
  225.         ghintint22=1;
  226.         doneyet = doneyet + 1;
  227.         call habitraildone;
  228.         call findlowestunsolved;
  229.         call movehintpos;
  230.     }
  231.     
  232.     return;        
  233.         
  234. # ========================================================================================
  235. entered:
  236.     
  237.     if (GetSourceRef() != player) return;
  238.     
  239.     if ((GetSenderRef() == ghint03_sector) && (ghintint03 == 0))
  240.     {
  241.         ghintint03=1;                               //set this hint solved
  242.         curhintref=0;                               //set current hint group reference num
  243.         call findlowestunsolved;                    //find the lowest unsolved hint in that group
  244.         call movehintpos;                           //pop the hint to the next valid hint position
  245.     }
  246.     
  247.     if ((GetSenderRef() == ghint07_sector) && (ghintint07 == 0))
  248.     {
  249.         ghintint07=1;                               //set this hint solved
  250.         curhintref=0;                               //set current hint group reference num
  251.         call findlowestunsolved;                    //find the lowest unsolved hint in that group
  252.         call movehintpos;                           //pop the hint to the next valid hint position
  253.     }
  254.     
  255.     if ((GetSenderRef() == ghint09_sector) && (ghintint09== 0))
  256.     {
  257.         ghintint09=1;                               
  258.         curhintref=9;                               
  259.         call findlowestunsolved;                    
  260.         call movehintpos;                           
  261.     }
  262.     
  263.     if ((GetSenderRef() == ghint12_sector) && (GetSourceRef() == player) && (ghintint12 == 0))
  264.     {
  265.         ghintint12=1;                         
  266.         curhintref=9;                 
  267.         call findlowestunsolved;      
  268.         call movehintpos;
  269.     }
  270.     
  271.     if ((GetSenderRef() == ghint16_sector) && (ghintint16== 0))
  272.     {
  273.         ghintint16=1;                               
  274.         curhintref=16;                               
  275.         call findlowestunsolved;                    
  276.         call movehintpos;                           
  277.     }
  278.     
  279.     if ((GetSenderRef() == ghint17_sector) && (ghintint17== 0))
  280.     {
  281.         ghintint17=1;                               
  282.         curhintref=16;                               
  283.         call findlowestunsolved;                    
  284.         call movehintpos;                           
  285.     }
  286.     
  287.     if ((GetSenderRef() == ghint20_sector) && (ghintint20 == 0))
  288.     {
  289.         ghintint20=1;                               
  290.         curhintref=20;                               
  291.         call findlowestunsolved;                    
  292.         call movehintpos;                           
  293.     }
  294.     
  295.     if ((GetSenderRef() == ghint21_sector) && (ghintint21 == 0))
  296.     {
  297.         ghintint21=1;                               
  298.         curhintref=20;                               
  299.         call findlowestunsolved;                    
  300.         call movehintpos;                           
  301.     }
  302.     
  303.     if ((GetSenderRef() == ghint23_sector) && (ghintint23 == 0))
  304.     {
  305.         //checking to see if hints are back to linear
  306.         ghintint23=1;                               
  307.         doneyet = doneyet + 1;
  308.         call habitraildone;                               
  309.         call findlowestunsolved;                    
  310.         call movehintpos;                           
  311.     }
  312.     
  313. return;
  314.  
  315. # ========================================================================================
  316. arrived:
  317.     
  318.     if (GetSenderRef() == ghint10_key)
  319.     {
  320.         //print("hint 10 key solved");
  321.         ghintint10=1;
  322.         curhintref=9;                               //switching to subhint group 9
  323.         call findlowestunsolved;
  324.         call movehintpos;       
  325.     }
  326.     
  327.     if (GetSenderRef() == ghint11)
  328.     {
  329.         ghintint11=1;
  330.         curhintref=9;                               //switched to subhint group 9
  331.         call findlowestunsolved;
  332.         call movehintpos;       
  333.     }
  334.     
  335. return;    
  336.  
  337. # ========================================================================================
  338. damaged:
  339.  
  340.     if ((GetSenderRef() == ghint19_birdidol) && (ghintint19 == 0))
  341.     {
  342.         // at birdidol setting hint refnum back to 0
  343.         ghintint18=1;
  344.         curhintref=0;
  345.         call findlowestunsolved;
  346.         call movehintpos;
  347.     }
  348.     
  349.     
  350.     if ((GetSenderRef() == ghint13) && (GetParam(1) == 0x10) && (ghintint13 == 0))
  351.     {
  352.         ghintint13=1;                         
  353.         curhintref=9;                 
  354.         call findlowestunsolved;      
  355.         call movehintpos;
  356.     }             
  357.     
  358. return;
  359.  
  360. # ========================================================================================
  361. crossed:
  362.  
  363.     if ((GetSenderRef() == gh8_index9_surf_in) && (GetSourceRef() == player))
  364.     {
  365.         //switch to subgroup 9 *NOTE not setting ghintint08 to 1*
  366.         curhintref=9;                               
  367.         call findlowestunsolved;
  368.         call movehintpos;       
  369.     }
  370.     
  371.     if ((GetSenderRef() == gh8_index0_surf_out) && (GetSourceRef() == player))
  372.     {
  373.         //switch to subgroup 0 *NOTE not setting ghintint08 to 1*
  374.         curhintref=0;                               
  375.         call findlowestunsolved;
  376.         call movehintpos;       
  377.     }
  378.     
  379.     if ((GetSenderRef() == gh8_index16_surf_in) && (GetSourceRef() == player))
  380.     {
  381.         //switch to subgroup 16 *NOTE not setting ghintint08 to 1*
  382.         curhintref=16;                               
  383.         call findlowestunsolved;
  384.         call movehintpos;       
  385.     }
  386.     
  387.     if ((GetSenderRef() == gh8_index16_surf_out) && (GetSourceRef() == player))
  388.     {
  389.         //switch to subgroup 0 *NOTE not setting ghintint08 to 1*
  390.         curhintref=0;                               
  391.         call findlowestunsolved;
  392.         call movehintpos;       
  393.     }
  394.     
  395.     if ((GetSenderRef() == gh8_index20_surf_in) && (GetSourceRef() == player))
  396.     {
  397.         //switch to subgroup 20 *NOTE not setting ghintint08 to 1*
  398.         curhintref=20;                               
  399.         call findlowestunsolved;
  400.         call movehintpos;       
  401.     }
  402.     
  403.     if ((GetSenderRef() == gh8_index20_surf_out) && (GetSourceRef() == player))
  404.     {
  405.         //switch to subgroup 0 *NOTE not setting ghintint08 to 1*
  406.         curhintref=0;                               
  407.         call findlowestunsolved;
  408.         call movehintpos;       
  409.     }
  410.     
  411.     if ((GetSenderRef() == gh8_index23_surf_in) && (GetSourceRef() == player))
  412.     {
  413.         //switch to subgroup 23 *NOTE not setting ghintint08 to 1*
  414.         curhintref=23;                               
  415.         call findlowestunsolved;
  416.         call movehintpos;       
  417.     }
  418.     
  419.     if ((GetSenderRef() == gh8_index23_surf_out) && (GetSourceRef() == player))
  420.     {
  421.         //switch to subgroup 0 *NOTE not setting ghintint08 to 1*
  422.         curhintref=0;                               
  423.         call findlowestunsolved;
  424.         call movehintpos;       
  425.     }
  426.     
  427. return;
  428.  
  429. # ========================================================================================
  430. user1:
  431.     
  432.     //from the TEO_MirrorDoor
  433.     curhintref=24;
  434.     call findlowestunsolved;
  435.     call movehintpos;
  436.     
  437. return;
  438.  
  439. # ========================================================================================
  440.  
  441. user4:
  442.  
  443.     if (ghintint04 == 0)
  444.     {
  445.         ghintint04=1;
  446.         curhintref=0;
  447.         call findlowestunsolved;
  448.         call movehintpos;
  449.     }
  450.  
  451. return;
  452.  
  453. # ========================================================================================
  454.  
  455. user5:
  456.  
  457.     if (ghintint05 == 0)
  458.     {
  459.         ghintint05=1;
  460.         curhintref=0;
  461.         call findlowestunsolved;
  462.         call movehintpos;
  463.     }
  464.  
  465. return;
  466.  
  467. # ========================================================================================
  468.  
  469. user6:
  470.  
  471.     if (ghintint06 == 0)
  472.     {
  473.         ghintint06=1;
  474.         curhintref=0;
  475.         call findlowestunsolved;
  476.         call movehintpos;
  477.     }
  478.  
  479. return;
  480.  
  481. # ========================================================================================
  482. findlowestunsolved:
  483.  
  484.     //print("finding lowest unsolved hint");
  485.     hintint_index=curhintref;                       //set index to current hint reference
  486.     
  487.     while((ghintint00[hintint_index]) == 1)         //while the flag associated with hint is solved increment index
  488.     {
  489.         hintint_index=hintint_index + 1;
  490.     }
  491.     
  492.     curhintindex=hintint_index;                     //when the flag is equal to 0 pull the index and assign to curhintindex
  493.         
  494. return;
  495.  
  496. # ========================================================================================
  497. movehintpos:
  498.  
  499.     //print("popping hint");
  500.     TeleportThing(curhint, ghint00[curhintindex]);  //pops the hint to the lowest unsolved hint in the appropriate area
  501.  
  502. return;
  503.  
  504. # ========================================================================================
  505. habitraildone:
  506.  
  507.     if (doneyet == 4)
  508.     {
  509.         curhintref=24;
  510.         //print("all areas are done setting hints to subgroup 24");
  511.     }
  512.     else
  513.     {
  514.         curhintref=0;
  515.     }
  516.     
  517. return;    
  518.     
  519. # ========================================================================================
  520.     
  521. end
  522.  
  523.